package com.chuangan.releasetask.job;

import com.chuangan.releasetask.enums.TaskStatusEnum;
import com.chuangan.releasetask.mapper.TaskMapper;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @Author: zihua
 * @Date: 2020/8/19 16:05
 * @Version 1.0
 */
public class TaskJob implements Job {

    @Autowired
    private TaskMapper taskMapper;

    @Override
    public void execute(JobExecutionContext jobExecutionContext) {
        taskMapper.autoUpdate((String)jobExecutionContext.getJobDetail().getJobDataMap().get("taskID"), TaskStatusEnum.EXPIRED.getCode(),TaskStatusEnum.AUDITED.getCode());
    }

}
